<template>
  <div class="continue-card" v-if="$props.data">
    <div class="content-column" @click="$emit('enter')">
      <div>进度：{{ $props.data.instance }}</div>
      <div>总时长：{{ $props.data.save_duration }}</div>
      <div>最后时间:{{ $props.data.save_time }}</div>
    </div>
    <div class="button-column">
      <cg-button color="red" @click="$emit('delete')">删除</cg-button>
    </div>
  </div>
</template>

<script setup lang="ts">
defineOptions({
  name: "continue-card",
});

const $props = defineProps({
  data: Object,
});

const $emit = defineEmits(["enter", "delete"]);

</script>

<style lang="scss">
.continue-card {
  display: flex;
  border: 1px solid #333;
  min-height: 4rem;
  cursor: pointer;
  box-sizing: border-box;

  .content-column {
    flex: 1;
    padding: 1rem;
  }

  .button-column {
    display: flex;
    flex: 0;
    padding: 0 1rem;
    align-items: center;
  }
}

.continue-card + .continue-card {
  margin-top: 10px;
}
</style>
